import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * User: Thoughtworker
 * Date: 7/9/13
 * Time: 3:52 PM
 * To change this template use File | Settings | File Templates.
 */
public class Menu {

    private static final String PRINTBOOKLIST="1";
    private static final String RESERVEBOOK="2";
    private static final String PRINTUSERINFO="3";
    private static final String PRINTMOVIELIST="4";
    private static final String EXIT="5";

    private UserInput input = new UserInput();
    public void welcomeMessage(){
        System.out.println("Welcome to the library");
    }

    public void printMenuOptions(){
        System.out.println("1. View List of Books");
        System.out.println("2. Reserve a Book");
        System.out.println("3. Check membership details");
        System.out.println("4. View List of Movies");
        System.out.println("5. Exit");

    }

    public String selectMenuOption(){
        boolean flag=true;
        String userInput=null;
        while (flag){
            System.out.print("Selection a Menu Option by number:") ;
            userInput= input.getUserInput();
            flag=!checkForValidInput(userInput);
        }
        return userInput;
    }

    public boolean checkForValidInput(String userInput){
        if (userInput.equals(PRINTBOOKLIST) || userInput.equals(RESERVEBOOK) || userInput.equals(PRINTUSERINFO)  || userInput.equals(PRINTMOVIELIST) || userInput.equals(EXIT))
            return true;
        else System.out.print("Select a valid option!"); return false;
    }

    public void printSeeLibrarian(){
        System.out.println("Please Talk to a Librarian. Thank you!");
    }

    public String enterBookTitle() {
        System.out.println("Please enter the title of the book.");
        return input.getUserInput();

    }

}
